﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.IO;

namespace ggprot
{
    public class GGMultiloginItem
    {
        private int loginIp;
        private int flags;
        private int features;
        private int loginTime;
        private long connId;
        private int unknown;
        private int nameSize;
        private string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public int NameSize
        {
            get { return nameSize; }
            set { nameSize = value; }
        }

        public int Unknown
        {
            get { return unknown; }
            set { unknown = value; }
        }

        public int LoginIp
        {
            get { return loginIp; }
            set { loginIp = value; }
        }

        public int Flags
        {
            get { return flags; }
            set { flags = value; }
        }

        public int Features
        {
            get { return features; }
            set { features = value; }
        }

        public int LoginTime
        {
            get { return loginTime; }
            set { loginTime = value; }
        }

        public long ConnId
        {
            get { return connId; }
            set { connId = value; }
        }

        public void Read(NetworkStream stream)
        {
            BinaryReader reader = new BinaryReader(stream);
            loginIp = reader.ReadInt32();
            flags = reader.ReadInt32();
            features = reader.ReadInt32();
            loginTime = reader.ReadInt32();
            connId = reader.ReadInt64();
            unknown = reader.ReadInt32();
            nameSize = reader.ReadInt32();
            name = string.Concat(reader.ReadChars(nameSize));
        }
    }
}
